//
//  DataBaseManager.h
//  UI23_FMDB
//
//  Created by dllo on 16/3/14.
//  Copyright © 2016年 LanOu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDB.h"

@interface DataBaseManager : NSObject

+ (DataBaseManager *)shareInstance;

@property (nonatomic , strong)  FMDatabase *db;/**< 数据库对象 */

@property (nonatomic , strong)  NSString *filePath;/**< 数据库路径 */

// 开启数据库
- (void)openDB;
// 关闭数据库
- (void)closeDB;

/***  音频下载表 */
//-(void)createAudioDownloadTable;
//-(NSMutableArray *)selectDownloadAudios;
//-(BOOL)insertAudionWithCourse:(LGFollwCourseModel *)course mediaModel:(LGFollowMediaModel *)model;

/***  系统通知消息表 */
- (void)creatSystemNewsTableWithUserid:(NSString *)userid;
- (BOOL)insertSystemNewsWithDic:(NSDictionary *)dic sendTime:(NSString *)sendTime messageid:(NSString *)messageid userid:(NSString *)userid;
- (BOOL)updateSystemNewsWithDic:(NSDictionary *)dic sendTime:(NSString *)sendTime Messagekey:(NSString *)messagekey messageid:(NSString *)messageid userid:(NSString *)userid;

- (BOOL)deleteSystemNewsWithMessagekey:(NSString *)messagekey userid:(NSString *)userid;
- (BOOL)updateSystemNewsWithMessagekey:(NSString *)messagekey userid:(NSString *)userid;
- (NSDictionary *)selectSystemNewsWithMessageid:(NSString *)messageid userid:(NSString *)userid;
- (NSDictionary *)selectSystemNewsWithMessagekey:(NSString *)messagekey userid:(NSString *)userid;
- (NSMutableArray *)selectSystemNewsWithReaded:(NSString *)Readed userid:(NSString *)userid;
- (NSMutableArray *)selectAllSystemNewsUserid:(NSString *)userid;

/***  我的通知消息表 */
- (void)creatMyNewsTableWithUserid:(NSString *)userid;
- (BOOL)insertMyNewsWithDic:(NSDictionary *)dic sendTime:(NSString *)sendTime messageid:(NSString *)messageid userid:(NSString *)userid;
- (BOOL)deleteMyNewsWithMessagekey:(NSString *)messagekey userid:(NSString *)userid;
- (BOOL)updateMyNewsWithMessagekey:(NSString *)messagekey userid:(NSString *)userid;
- (NSDictionary *)selectMyNewsWithMessageid:(NSString *)messageid userid:(NSString *)userid;
- (NSMutableArray *)selectMyNewsWithReaded:(NSString *)Readed userid:(NSString *)userid;
- (NSMutableArray *)selectAllMyNewsUserid:(NSString *)userid;
- (BOOL)deleteSystemNewsWithUserid:(NSString *)userid ;




@end
